<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>

    class myCalculator {
      constructor(num) {
        this.num = num
      }
      add(count) {
        this.num += count
        return this
      }
      minus(count) {
        this.num -= count
        return this
      }
      div(count) {
        this.num /= count
        console.log(this);
        return this
      }
      pow(count) {
        this.num *= count
        console.log(this);
        return this
      }
    }

    const calulator = new myCalculator(123)
    calulator.add(1).minus(2).div(2).pow(2);
  </script>
</body>

</html>